package org.example.service;

import org.example.entiey.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@Service
@FeignClient(name = "spring-cloud-alibaba-provider")
public interface FeignService {
    @GetMapping(value = "/port")
    public String getPort();

    //feign的参数绑定
    @GetMapping(value = "/hello1")
    public String hello(@RequestParam("name") String name);

    @PostMapping(value = "/hello2")
    public String hello(@RequestBody User user);
}
